local jingtao=require "packages/water/jingtao"
--local langchao=require "packages/water/langchao"
--local langchaomini=require "packages/water/langchaomini"
--local ljwswj = require "packages/water/ljwswj"
--local fsn = require "packages/water/fsn"
local zhonglang = require "packages/water/pkg/zhonglang"
--local dingzhi = require "packages/water/acg_dingzhi"

--local huying = require "packages/water/huying"
--[[

--消灭模式
local banmode={"tenyear_1v2","joy_mode","joy2v2_mode","joy_1v2_mode","qyhl_mode","zombie_mode","as_vanished_dragon_twenty","as_StonehengEarena_mode"
,"meleemode", "aab_role_mode","qyUnion","nian_capturing","kangqin_mode","new_role_mode"
, "as_vanished_dragon_StonehengEarena"}
for _,name in ipairs(banmode) do
   Fk.game_modes[name] = nil
end
--]]





--[[
Fk:addSkills(AuxSkills)
AuxSkills={}
--]]

--[
--穿透room！
local Room
--local GameLogic

if not FileIO.pwd():endsWith("packages/freekill-core") then
  print("cd packages/freekill-core")
  FileIO.cd("packages/freekill-core")
  GameEvent = require "server.gameevent"

  Room=require "lunarltk.server.room"
  --GameLogic=require "server.gamelogic"
  --ServerPlayer = require "server.serverplayer"
  FileIO.cd("../..")


else
  Room=require "server.room"
  --GameLogic=require "server.gamelogic"
  --ServerPlayer = require "server.serverplayer"
end
--[
--Room=dofile("packages/freekill-core/lua/server/room.lua")
--local Room=require "packages/freekill-core/lua/server/room"
--- 改变玩家的护甲数
---@param player ServerPlayer
---@param num integer @ 变化量
function Room:changeShield(player, num,reason)
  if num == 0 then return end
  local reason=reason or "game_rule"
  local data={
    to=player,
    num=num,
    reason=reason,
  }
  self.logic:trigger(T.ShieldChanged, player, data)
  player.shield = math.max(player.shield + data.num, 0)
  player.shield = math.min(player.shield, 999)
  self:broadcastProperty(player, "shield")
  self.logic:trigger(T.AfterShieldChanged, player, data)

end




--- 让一名玩家获得一张牌(兼容id)
---@param player ServerPlayer|integer @ 要拿牌的玩家
---@param card integer|integer[]|Card|Card[] @ 要拿到的卡牌
---@param visible? boolean @ 是否明着拿
---@param reason? CardMoveReason @ 卡牌移动的原因
---@param proposer? ServerPlayer @ 移动操作者的id
---@param skill_name? string @ 技能名
---@param moveMark? table|string @ 移动后自动赋予标记，格式：{标记名(支持-inarea后缀，移出值代表区域后清除), 值}
---@param visiblePlayers? integer|integer[] @ 控制移动对特定角色可见（在moveVisible为false时生效）
function Room:obtainCard(player, card, visible, reason, proposer, skill_name, moveMark, visiblePlayers)
  local player=player
  if type(player) == "number" then
    player = self:getPlayerById(player)
  end
  self:moveCardTo(card, Card.PlayerHand, player, reason, skill_name, nil, visible, proposer or player, moveMark, visiblePlayers)

end
--]
--兼容玩家

--- 根据角色id，获得那名角色本人，兼容玩家
---@param id integer @ 角色的id
---@return ServerPlayer @ 这个id对应的ServerPlayer实例
function Room:getPlayerById(id)
  if not id then return nil end
  if type(id) ~= "number" and id.id and id.room then--兼容老函数参数，现在传的是玩家了
    return id
  end
  assert(type(id) == "number")

  for _, p in ipairs(self.players) do
    if p.id == id then
      return p
    end
  end

  return nil
end
--]]
return{
   jingtao,zhonglang
  }